package com.webflux.routes;

import com.webflux.handlers.Service1Handler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

@Configuration
public class Service1Route {

    @Bean
    public RouterFunction<ServerResponse> routerFunction(Service1Handler service1Handler){
       return RouterFunctions.route()
                .GET("/s1/get/{productId}",service1Handler::findProduct)
                .build();
    }
}
